package com.xgame.server.constants;

import com.xgame.server.netty.proto.Cmdcode;

public enum RpcEnums {

    LOGIN(new Integer(Cmdcode.LoginCmdCode.CS_LOGIN_REQ.getNumber()), "loginHandler"),
    REGISTER(new Integer(Cmdcode.LoginCmdCode.CS_REGISTER_REQ.getNumber()), "loginHandler"),
    CHECK(new Integer(Cmdcode.LoginCmdCode.CS_CHECK_REQ.getNumber()), "loginHandler"),
    CHECKDOWN(new Integer(Cmdcode.LoginCmdCode.CS_CHECKDOWNLOAD_REQ.getNumber()), "loginHandler"),
    DOWNLOAD(new Integer(Cmdcode.SaveCmdCode.CS_GAME_DOWNLOAD_REQ.getNumber()), "loginHandler"),
    ACCOUNT_SAVE(new Integer(Cmdcode.SaveCmdCode.CS_ACCOUNT_SAVE_REQ.getNumber()), "accountHandler"),
    ACCOUNTRECORD_SAVE(new Integer(Cmdcode.SaveCmdCode.CS_ACCOUNTRECORD_SAVE_REQ.getNumber()), "accountrecordHandler"),
    BAGITEM_SAVE(new Integer(Cmdcode.SaveCmdCode.CS_BAG_SAVE_REQ.getNumber()), "bagitemHandler"),
    BOSSRANK_SAVE(new Integer(Cmdcode.SaveCmdCode.CS_BOSSRANK_SAVE_REQ.getNumber()), "bossrankHandler"),
    BOSSSPAWN_SAVE(new Integer(Cmdcode.SaveCmdCode.CS_BOSSSPAWN_SAVE_REQ.getNumber()), "bossspawnHandler"),
    COPYMAP_SAVE(new Integer(Cmdcode.SaveCmdCode.CS_COPYMAP_SAVE_REQ.getNumber()), "copymapHandler"),
    ENROLLREFRESH_SAVE(new Integer(Cmdcode.SaveCmdCode.CS_ENROLLREFRESH_SAVE_REQ.getNumber()), "enrollrefreshHandler"),
    EQUIP_SAVE(new Integer(Cmdcode.SaveCmdCode.CS_EQUIP_SAVE_REQ.getNumber()), "equipHandler"),
    GAMECFG_SAVE(new Integer(Cmdcode.SaveCmdCode.CS_GAMECFG_SAVE_REQ.getNumber()), "gamecfgHandler"),
    GAMERECORD_SAVE(new Integer(Cmdcode.SaveCmdCode.CS_GAMERECORD_SAVE_REQ.getNumber()), "gamerecordHandler"),
    HERO_SAVE(new Integer(Cmdcode.SaveCmdCode.CS_HERO_SAVE_REQ.getNumber()), "heroHandler"),
    ROLESPAWN_SAVE(new Integer(Cmdcode.SaveCmdCode.CS_ROLESPAWN_SAVE_REQ.getNumber()), "rolespawnHandler"),
    SHOPREFRESH_SAVE(new Integer(Cmdcode.SaveCmdCode.CS_SHOPREFRESH_SAVE_REQ.getNumber()), "shoprefreshHandler"),
    TASKLIST_SAVE(new Integer(Cmdcode.SaveCmdCode.CS_TASKLIST_SAVE_REQ.getNumber()), "tasklistHandler"),
    GROWUPWELF_SAVE(new Integer(Cmdcode.SaveCmdCode.CS_GROWUPWELF_SAVE_REQ.getNumber()), "growupwelfHandler"),
    PURGATORY_SAVE(new Integer(Cmdcode.SaveCmdCode.CS_PURGATORY_SAVE_REQ.getNumber()), "purgatoryHandler"),
    FUCKIOS_SAVE(new Integer(Cmdcode.SaveCmdCode.CS_IOSPURCHASE_SAVE_REQ.getNumber()), "fuckiosHandler");

    private Integer code;

    private String beanName;

    RpcEnums(Integer code, String beanName) {
        this.code = code;
        this.beanName = beanName;
    }

    public static String getBeanName(Integer code) {
        for (RpcEnums item : RpcEnums.values()) {
            if (item.code.equals(code)) {
                return item.beanName;
            }
        }
        return null;
    }
}
